import request from '@/router/axios';

export const getList = (page, size, params) => {
  return request({
    url: '/base/goodsSpecProperty/list',
    method: 'post',
    params: {
      ...params,
      page,
      size,
    }
  })
}
export const remove = (goodsClassId, gsfId) => {
  return request({
    url: '/base/goodsClassSpec/delete',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: {
      goodsClassId,
      gsfId
    }
  })
}
export const add = (row) => {
  return request({
    url: '/base/goodsSpecProperty/add',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/base/goodsSpecProperty/edit',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: row
  })
}

export const changeStatus = (userId, status) => {
  return request({
    url: '/base/goodsSpecProperty/changeStatus',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: {
      userId,
      status
    }
  })
}

export const getspecPrototype = (data) => {
  return request({
    url: '/base/goodsClassSpec/findSpecByClass',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: {
      ...data
    }
  })
}

export const getAllSalesProp = (page, size, params) => {
  return request({
    url: '/base/specification/specificationAndSpecList',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: {
      ...params,
      page,
      size
    }
  })
}

export const setAddProp = (goodsClassId, gsfId, specType) => {
  return request({
    url: '/base/goodsClassSpec/addItem',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: {
      goodsClassId,
      gsfId,
      specType
    }
  })
}